<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div>内容</div>
<script>
    // number undefined null boolean string array object 
    var num = 12;
    console.log(num + 12);//24

    var str = "文字";
    console.log(str + "这是拼接的文字");//文字

    var str1 = `字符串${num}`;

    str = "12";
    // =赋值  ==等于  ===全等于
    if(num === str * 1){
        console.log("成立");
    }

    // 两个都是正值就输出第一个正值
    console.log(str || num);// "12"
    // 两个值,一真一假输出真值
    console.log(str || false);// "12"
    console.log(false || str);// "12"
    // 两个假值,输出后边的
    console.log(false || undefined);// undefined

    
    console.log(str && 0 && 10); //0

    var arr = [1,2,3,4];
    console.log(arr);

    arr.forEach(function(item,index,array){

    })

    var obj = {
        name:"aaa",
        age:18,
    }
    console.log(obj.name);
    console.log(obj["name"]);

    for(var key in obj){
        // key  "name"
        console.log(obj[key]);

    }

</script>
</body>
</html>